
#ifndef __CE_CLIPPER_H__
#define __CE_CLIPPER_H__

#include <cegfx/ce.h>
#include <cegfx/ceboundingbox.h>
#include <cegfx/ceexport.h>
#include <d3dx9.h>
#include <vector>

using std::vector;

class CE_GFX_API ceClipper
{
private:
	vector<D3DXPLANE>	planes;

public:
	ceClipper ();

	void Clear ();

	void AddPlane (const D3DXPLANE& plane);
	void AddPlane (const D3DXVECTOR3& p, const D3DXVECTOR3& n);
	void AddPlane (const D3DXVECTOR3& p0, const D3DXVECTOR3& p1, const D3DXVECTOR3& p2);

	ClippingResult Test (const D3DXVECTOR4& p, float d) const;
	ClippingResult Test (const D3DXVECTOR4& p) const;
	ClippingResult Test (const D3DXVECTOR3& p) const;
	ClippingResult Test (const ceBoundingBox& bbox) const;
	ClippingResult Test (const D3DXVECTOR3* points, unsigned numPoints) const;

};

#endif /* ! __CE_CLIPPER_H__ */
